﻿using System;

namespace SG.Sys.Console.CommandProcessing
{
    public class Entry
    {
        public Entry(ICommandHistory parent, string prompt, string command)
        {
            Path = prompt;
            Time = DateTime.Now;
            Parent = parent;

            Command = Parent.Parser(command);
        }

        public ICommandHistory Parent { get; private set; }
        public string Path { get; private set; }
        public Command Command { get; private set; }
        public DateTime Time { get; private set; }

        public override string ToString()
        {
            return Time.ToString("s") + " in " + Path + ">" + Command.Normalized;
        }
    }
}
